package com.stylefeng.guns.modular.wx.controller;

import com.stylefeng.guns.core.util.Page.Element;
import com.stylefeng.guns.core.util.Page.PageControl;
import com.stylefeng.guns.core.util.Page.WeChatVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

/**
 * 页面控制
 */
@Slf4j
@RestController
@Api(tags = "页面控制接口")
@RequestMapping(value = "/v1")
public class PageControlRestful {

    @GetMapping(value = "/getDefaultData")
    @ApiOperation("页面控制")
    public WeChatVo getPag() {
        PageControl pageControl = new PageControl();
        pageControl.setColor("#000");
        pageControl.setRightFirstIconType("bullet-list");
        pageControl.setRightSecondIconType("user");

        ArrayList<PageControl> list = new ArrayList<>();
        list.add(pageControl);

        Element element = new Element();
        element.setParams(list);
        element.setElement("AtNavBar");
        element.setClient("h5");
        ArrayList<Element> eleList = new ArrayList<>();
        eleList.add(element);
        eleList.add(element);
        eleList.add(element);

        return WeChatVo.success(eleList);
    }
}
